Skip to content

<fix>[backport]: ZSTAC-86784 migrate storage host filters#4589

Open
zstack-robot-2 wants to merge 1 commit into
5.4.12from
sync/shan.wu/fix-5.4.12-ZSTAC-86784-86786@@2
Open

<fix>[backport]: ZSTAC-86784 migrate storage host filters#4589
zstack-robot-2 wants to merge 1 commit into
5.4.12from
sync/shan.wu/fix-5.4.12-ZSTAC-86784-86786@@2

Conversation

@zstack-robot-2

Copy link
Copy Markdown
Collaborator

Backport for ZSTAC-86784. Source MR: zstackio/zstack!10312.

sync from gitlab !10559

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 12 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 34b5d12f-c693-4dc0-a01a-7e1eebd60f47

📥 Commits

Reviewing files that changed from the base of the PR and between 262b857 and ce0f965.

📒 Files selected for processing (5)
  • compute/src/main/java/org/zstack/compute/allocator/AttachedVolumePrimaryStorageAllocatorFlow.java
  • compute/src/main/java/org/zstack/compute/allocator/HostPrimaryStorageAllocatorFlow.java
  • header/src/main/java/org/zstack/header/vm/VmInstanceConstant.java
  • plugin/kvm/src/main/java/org/zstack/kvm/KVMHostAllocatorFilterExtensionPoint.java
  • plugin/localstorage/src/main/java/org/zstack/storage/primary/local/LocalStorageAllocatorFactory.java

Warning

.coderabbit.yaml has a parsing error

The CodeRabbit configuration file in this repository has a parsing error and default settings were used instead. Please fix the error(s) in the configuration file. You can initialize chat with CodeRabbit to get help with the configuration file.

💥 Parsing errors (1)
Could not fetch remote config from http://open.zstack.ai:20001/code-reviews/zstack-cloud.yaml: TimeoutError: The operation was aborted due to timeout
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Walkthrough

新增 MigrateStorage VM 操作类型,并将其接入附加卷、主存储、KVM 与本地存储的候选主机筛选流程;停止状态实例在 KVM 筛选中保留原候选集。

Changes

存储迁移分配

Layer / File(s) Summary
操作契约与主存储分配
header/.../VmInstanceConstant.java, compute/.../AttachedVolumePrimaryStorageAllocatorFlow.java, compute/.../HostPrimaryStorageAllocatorFlow.java
新增 MigrateStorage 枚举,并使附加卷及主存储分配流程采用对应的候选筛选路径。
主机筛选器接入
plugin/kvm/.../KVMHostAllocatorFilterExtensionPoint.java, plugin/localstorage/.../LocalStorageAllocatorFactory.java
KVM 属性筛选支持 MigrateStorage,停止状态实例直接保留候选集;本地存储容量筛选支持该操作。

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant VMOperation
  participant PrimaryStorageAllocator
  participant KVMFilter
  participant LocalStorageFilter
  VMOperation->>PrimaryStorageAllocator: MigrateStorage
  PrimaryStorageAllocator->>KVMFilter: 筛选候选主机
  PrimaryStorageAllocator->>LocalStorageFilter: 筛选本地存储容量
  KVMFilter-->>PrimaryStorageAllocator: 返回候选集
  LocalStorageFilter-->>PrimaryStorageAllocator: 返回候选集
Loading

Poem

小兔挥爪添新枚举,
存储迁移踏上云途。
主机筛选排成队,
停止实例候选留。
胡萝卜庆祝流程通!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed 标题简洁且准确概括了本次变更的核心:迁移存储主机过滤规则的回移。
Description check ✅ Passed 描述明确表明这是 ZSTAC-86784 的回移,与本次变更相关。
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sync/shan.wu/fix-5.4.12-ZSTAC-86784-86786@@2

Comment @coderabbitai help to get the list of available commands.

Introduce MigrateVolume host allocation semantics for storage migration so running VMs get KVM host property checks while stopped VMs skip runtime component version filtering.

Resolves: ZSTAC-75332

Change-Id: I6c393d7ec962d71fb5437d7a41d0891deb7abae7
@MatheMatrix
MatheMatrix force-pushed the sync/shan.wu/fix-5.4.12-ZSTAC-86784-86786@@2 branch from 262b857 to ce0f965 Compare July 17, 2026 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant